package model

import (
	"gorm.io/gorm"
	"time"
)

type User struct {
	Id        uint32         `gorm:"column:id;type:int UNSIGNED;comment:用户ID;primaryKey;not null;"  form:"id" json:"id"`                  // 用户ID
	Mobile    string         `gorm:"column:mobile;type:char(11);comment:手机号;not null;"  form:"mobile" json:"mobile"`                      // 手机号
	Password  string         `gorm:"column:password;type:char(32);comment:密码;not null;"  form:"password" json:"password"`                 // 密码
	Status    int8           `gorm:"column:status;type:tinyint(1);comment:状态 0:正常 1:冻结;not null;default:0;"  form:"status" json:"status"` // 状态 0:正常 1:冻结
	CreatedAt time.Time      `gorm:"column:created_at;type:datetime(3);not null;default:CURRENT_TIMESTAMP(3);"  form:"created_at" json:"created_at"`
	UpdatedAt time.Time      `gorm:"column:updated_at;type:datetime(3);not null;default:CURRENT_TIMESTAMP(3);"  form:"updated_at" json:"updated_at"`
	DeletedAt gorm.DeletedAt `gorm:"column:deleted_at;type:datetime(3);default:NULL;"  form:"deleted_at" json:"deleted_at"`
}

func (u User) TableName() string {
	return "user"
}
